package snailAI.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import snailAI.Entity.User;

import java.util.List;

/**
 * 用户表Mapper接口（基于注解，无需XML）
 */
@Mapper // 标记为MyBatis Mapper，由Spring自动扫描注入
public interface UserMapper extends BaseMapper<User> {
@Select("select chat_id from user_chatid where user_id=#{id} ")
    List<String> getMessageListIds(@Param("id") int id);

@Insert("insert into user_chatid(user_id, chat_id) values (#{user_id},#{chat_id})")
    int insertMessageList(@Param("user_id") int user_id,@Param("chat_id") String chat_id);
}